package com.zz.ecommerce.searchManage.ent;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 电商企业基本信息查询
 * <p/>
 * 电商企业信用查询
 */
@Controller
@RequestMapping("searchManage/ebEnt")
public class EbEntInfoController {

    @Autowired
    private EntRegDistService entRegCollService;

    /**
     * 跳转到初始化查询页面
     *
     * @return
     */
    @RequestMapping("/info/init")
    public String init() {
        return "searchManage/ebent/info/index";
    }

    /**
     * 跳转到初始化查询页面
     *
     * @return
     */
    @RequestMapping("/credit/init")
    public String initCredit() {
        return "searchManage/ebent/credit/index";
    }

    /**
     * @param request
     * @return
     */
    @RequestMapping("/queryEbEntInfoStatus")
    @ResponseBody
    public GridResult queryEbEntInfoStatus(TEntRegDist tEntRegColl, GridRequest request) {
        List<TEntRegDist> entRegCollList = entRegCollService.queryEntRecords(request, tEntRegColl, "");
        long cnt = entRegCollService.getEntRecordsCnt(tEntRegColl, "");
        return new GridResult(entRegCollList, request, cnt);
    }

    /**
     * @param request
     * @return
     */
    @RequestMapping("/queryEbEntCreditInfo")
    @ResponseBody
    public GridResult queryEbEntCreditInfo(TEntRegDist tEntRegColl, GridRequest request) {
        List<TEntRegDist> entRegCollList = entRegCollService.queryEntRecords(request, tEntRegColl, "");
        long cnt = entRegCollService.getEntRecordsCnt(tEntRegColl, "");
        return new GridResult(entRegCollList, request, cnt);
    }
}
